(:
  A procedure to select the contents of coffee quick chat interventions
 in version 3.0).
  
  all items contain infos:
  	software
  	tool
  	step
  	time
  	src-anchor
  	group
  	user
  	type
  	content
  	
:)

declare boundary-space strip;
import module namespace
    jj = "http://kumquat.emse.fr/utilitaires"
    at "jjutils.xq" ;
import module namespace
    coffee = "http://tatiana.emse.fr/coffee"
    at "coffee-utils.xq" ;

<display>{

let $t := $arguments[1]
let $doc := doc($t)
let $msgs := coffee:get-messages($doc)
let $newmsgs := $msgs[.//(QuickMessage)]
for $msg at $p in $newmsgs
let $quickchat := $msg//QuickMessage
  return

  <item>{ 
  
  	(:	<info name="software">{"coffee:softwarename"}</info>,:)
      <info name="tool">quickChat</info>,
      <info name="time"><time><date>{coffee:get-timemillis($msg)}</date></time></info>,
    	<info name="src-anchor"><anchor>{
      	<doc>{ $t }</doc>,
      	<path>{jj:build-Path($msg)}</path>
    	}</anchor></info>,
      <info name="from">{xs:string($quickchat/@from)}</info>,
      <info name="to">{xs:string($quickchat/@to)}</info>,
      <info name="content"><text>{xs:string($quickchat/@text)}</text></info>
      }</item>
}</display>
